/**
 * @Author: lifuzhao
 * @Date: 2019-07-11
 * @Project: driver
 */
import md5 from 'js-md5'

export default {
  setToken(state, token) {
    state.token = token
    sessionStorage.setItem('token', token)
  }
  , setUser(state, user) {
    state.user = user
    sessionStorage.setItem('user', user)
  }
  , setLoginTime(state, loginTime) {
    state.loginTime = loginTime
    sessionStorage.setItem('loginTime', loginTime)
  }
  , setGrade(state, grade) {
    let mdStr = md5('grade_' + grade)
    state.grade = mdStr
    sessionStorage.setItem('grade', mdStr)
  }
  , setOrderDetailData(state, detailData) {
    state.orderDetailData = detailData
  }
  , setOrderRouteData(state, routeData) {
    state.orderRouteData = routeData
  }
  , setCouponList(state, couponList) {
    state.couponList = couponList
  }
}
